package net.huashitong.supervision.task.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.supervision.task.dao.TaskLogEntityDao;
import net.huashitong.supervision.task.entity.TaskLogEntity;
import net.huashitong.supervision.task.filter.LogFilter;
import net.huashitong.user.filter.LoginFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2020/1/13
 * Time: 15:18
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
public class TaskLogEntityService extends StringPKService<TaskLogEntity> {
    @Autowired
    private TaskLogEntityDao taskLogEntityDao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<TaskLogEntity, String> getDao() {
        return taskLogEntityDao;
    }
    @Override
    protected void beforeSave(TaskLogEntity obj) {
        obj.setSysId(tableService.updateMaxSysId("t_task_log_entity", null));
    }

    public List<TaskLogEntity> queryFilter(LogFilter filter) {
        return taskLogEntityDao.queryFilter(filter);
    }
}
